function [NewAgeStates,NewExoTimeStates,NewPrice] = SimulationForward(Pa,OldAgeStates,States,OldExoTimeStates,Boxes,pproc,opt)

% Compute new ExoTimeStates using OldAgeStates and OldPrices ...
[NewExoTimeStates,NewPrice] = SimulationExoTimeStatesNoShock(OldExoTimeStates,States,pproc);

% First, based on OldAgeStates, compute new Sugar Road Distance State:
OldInSugar = (OldAgeStates>1);
[UpdateProx] = BoxesProximityUpdate(OldInSugar,Boxes);
UpdateSRDStates = numel(States.SRDMidPoints(:,1)) - sum(UpdateProx,2);

% Classify fields in states...
[~,~,UpdateStateIdx] = StatesMapping(States.ExoFixedStates,NewExoTimeStates,OldAgeStates,UpdateSRDStates,opt);
% Other outputs from StatesMapping, FixedStatesMap and AllStatesMap, are identical to those elements already in States structure. 

% Simulate actions...
% Get choice probabilities:
Regions  = unique(States.RegionsForExoStates);
ChoiceProb = zeros(size(UpdateStateIdx,1),size(Pa{1},2));
for r = Regions'
    IsRegion = (States.RegionsForExoStates == r);
    ChoiceProb(IsRegion,:) = Pa{r}(UpdateStateIdx(IsRegion),:);
end

PP(:,1) = ChoiceProb(:,1); 
for c=2:size(ChoiceProb,2)
    PP(:,c) = PP(:,c-1) + ChoiceProb(:,c);
end
R = rand(size(ChoiceProb,1),1);
PP = bsxfun(@minus,PP,R);
PP = (PP<0);
Choice = sum(PP,2)+1;

NewAgeStates = zeros(size(OldAgeStates));
% Get NewAgeStates vector...
NewAgeStates(OldAgeStates > 1 & Choice == 1) = OldAgeStates(OldAgeStates > 1 & Choice == 1) + 1;
NewAgeStates(OldAgeStates > 1 & Choice == 2) = 2;
NewAgeStates(OldAgeStates > 1 & Choice == 3) = 1;
NewAgeStates(OldAgeStates == 1 & Choice == 1) = 1;
NewAgeStates(OldAgeStates == 1 & Choice == 2) = 2;

NewAgeStates(NewAgeStates > opt.MaxAge) = opt.MaxAge;
end



